layui.use(['jquery', 'okLayer', 'layer'], function () {
    let $ = layui.jquery;
    let okLayer = layui.okLayer;
    let layer = layui.layer;
    // 获取contentText
    const ctx = function () {
        let pathName = document.location.pathname;
        let index = pathName.substr(1).indexOf("/");
        let result = pathName.substr(0, index + 1);
        return result;
    }();
    // 获取student
    var student = JSON.parse(window.sessionStorage.getItem("student"));
    var url = ctx + "/pages/student/studentLogin.html";
    if (student == null) {
        okLayer.yellowSighMsg("登陆时间超时，请重新登录！", function () {
            window.sessionStorage.clear();
            window.open(url, "_top", "", "true");
        });
    }
    $.ajax({
        url: ctx + '/ygssecs/getstudentbyid',
        type: 'get',
        dataType: 'json',
        data: {stuid: student.stuid}
    }).done(function (res) {
        var studata = res.data;
        $("#stuname").html(studata.realname)
        $("#stuimg").attr('src', studata.photo);
    }).fail(function (e) {
        console.log(e)
    })


})

